package com.ijiuchuang.jc_localization.view.adapter;

import android.content.Context;

import com.ijiuchuang.jc_localization.R;
import com.ijiuchuang.jc_localization.bean.api.Keji;
import com.ijiuchuang.jc_localization.tools.adapter.ViewHolder;
import com.ijiuchuang.jc_localization.tools.adapter.recyclerview.CommonAdapter;
import com.ijiuchuang.jc_localization.tools.utils.DateUtil;

import java.util.List;

/**
 * Created by Veev on 2016/6/13
 *
 * @link 384506557@qq.com
 */
public class TrendsListRecyclerAdapter extends CommonAdapter<Keji.NewslistBean> {

    public TrendsListRecyclerAdapter(Context context, int layoutId, List<Keji.NewslistBean> datas) {
        super(context, layoutId, datas);
    }

    @Override
    public void convert(final ViewHolder holder, final Keji.NewslistBean keji) {
        holder.setText(R.id.recycler_item_keji_text_title, keji.getTitle());
        holder.setText(R.id.recycler_item_keji_text_desc, keji.getDescription());
        holder.setText(R.id.recycler_item_keji_text_date, DateUtil.dealTime(keji.getCtime()));
        holder.setImageByUrl(R.id.recycler_item_keji_image, keji.getPicUrl());
    }
}
